﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WPFTest.Commands;

namespace WPFTest.ViewModels
{
    public class MainWindowViewModel : NotificationObject
    {
        public DelegateCommand addCommand { get; set; }

        public MainWindowViewModel()
        {
            this.addCommand = new DelegateCommand();
            this.addCommand.ExecuteAction += this.Add;
        }

        private double value1;

        public double Value1
        {
            get { return value1; }
            set {
                value1 = value;
                this.RaisePropertyChanged("Value1");
            }
        }

        private double value2;

        public double Value2
        {
            get { return value2; }
            set { value2 = value;
                this.RaisePropertyChanged("Value2");
            }
        }

        private double result;

        public double Result
        {
            get { return result; }
            set { result = value;
                this.RaisePropertyChanged("Result");
            }
        }

        private void Add(object param)
        {
            this.Result = this.Value1 + this.Value2;
        }
    }
}
